<script src="/javascripts/tiny_mce/tiny_mce.js" type="text/javascript"></script>
<script src="/javascripts/mce_editor.js" type="text/javascript"></script>
<div class='form'>
  <% form_for @design,:html=>{:multipart=>true} do |f| %>
    <%= f.error_messages %>

    <p>
      <label>类别</label>
      <%for @category in Category.find(:all)%>
        <%=@category.name%>
        <%=check_box("category[]","id",{:checked=>@design.categories.include?(@category)},@category.id)%>
      <%end%>
    </p>

    <!--p>
      <label for="design_sex">性别</label>
      <%=  select("design","sex",Design::SEX,:prompt => "请选择..") %>
    </p-->

    <p>
      <label for="design_name">名称</label>
      <%= f.text_field :name %>
    </p>

    <p>
      <label for="design_sn">编号</label>
      <%= f.text_field :sn %>
    </p>

    <p>
      <label for="design_height">实际宽度</label>
      <%= f.text_field :width %>
    </p>

    <p>
      <label for="design_height">实际高度</label>
      <%= f.text_field :height %>
    </p>



    <p>
      <label for="design_price">价格</label>
      <%= f.text_field :price %>
    </p>

     <p>
      <label for="design_quantity">库存数量</label>
      <%= f.text_field :quantity,:size=>2 %>
    </p>

    <p>
      <label for="design_image─url">图片</label>
      <%= file_column_field "design", "image_url" %>
    </p>

    <p>
      <label for="design_description">描述</label>
      <%= f.text_area :description,:cols=>25,:rows=>4,:class =>"mce-editor" %>
    </p>

    <p>
      <label for="design_active">可用</label>
      <%= f.check_box :active %>
    </p>

    <p>
      <label for="design_active">精品阁</label>
      <%= f.check_box :recommend %>
    </p>

    <p>
      <%= f.submit button_name,:class=>'submit' %>
    </p>
  <% end %>
</div>